package TestDemo;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class TestDemo3 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("test1.txt")) {
            Scanner scanner = new Scanner(inputStream);
            while (scanner.hasNextLine()) {
                String s = scanner.nextLine();
                System.out.println(s);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
